function replaceText({ value = '', start = 0, end = 0, length = 0, mark = '*' } = {}): string {
  let arr = (value + '').split('')
  end = end ? end : value.length
  length = ~~length
  if (end && !length) {
    end = ~~end
    length = end - (~~start)
  }
  let _mark = mark
  for (let i = length; i > 1; i--) {
    mark += _mark
  }
  arr.splice(start, length, mark)
  return arr.join('')
}

export default replaceText 
